package com.jeomo.mem.starter.timedtask;

import com.jeomo.mem.starter.mapper.MemberCardMapper;
import com.jeomo.mem.starter.service.IMemPointsDetailService;
import com.jeomo.mem.starter.service.IMemberCardService;
import com.jeomo.mem.starter.service.impl.AdminMailService;
import com.jeomo.mem.starter.sysoption.PointsClearSysOption;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * 系统定期检查会员积分的计算是否异常
 *
 * @author:Jackpot
 * @create 2020-12-29 14:39
 * @description:
 */
@Component
public class PointsSecurityVarifyTimedTask {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @PostConstruct
    private void PointsSecurityVarify(){
        logger.info("[会员积分异常计算检查器]启动...");
    }


    class PointsSecurityVarifyJob implements Job {

        @Resource
        private PointsClearSysOption pointsClearSysOption;
        @Resource
        private MemberCardMapper memberCardMapper;
        @Resource
        private IMemberCardService memberCardService;
        @Resource
        private IMemPointsDetailService memPointsDetailService;

        @Resource
        private AdminMailService adminMailService;

        @Override
        public void execute(JobExecutionContext context) throws JobExecutionException {


            //1. 积分执行单上的积分与会员卡积分对应;

//            logger.error("会员卡号["+000+"]的积分计算出现异常!会员卡积分为["+111+"],积分执行单的合计积分为["+222+"]");

            //2. 会员积分明细与会员卡积分对应

        }
    }
}
